<?php

include '../../../configuration.php';

$smarty->template_dir = LOCAL_PATH.'administrator/main/templates/';
$smarty->compile_dir = LOCAL_PATH.'administrator/main/templates_c/';
$smarty->config_dir = LOCAL_PATH.'administrator/main/configs';

$smarty->compile_check = true;
//$smarty->debugging = true;

$faculties = array();
$f_id = array();
$ids = array();
$groups = array();

$result = mysql_query("SELECT * FROM `groups` ORDER BY `faculty_id` ASC");
while($rows = mysql_fetch_array($result, MYSQL_ASSOC)){
	$f_id[] = $rows["faculty_id"];
	$ids[] = $rows["group_id"];
	$groups[] = $rows["group_name"];
}
$result2 = mysql_query("SELECT * FROM `faculties`");
while ($rows2 = mysql_fetch_array($result2, MYSQL_ASSOC)) {
	for($i = 0; $i < count($f_id); $i++){
		if ($f_id[$i] == $rows2["faculty_id"]) {
			$faculties[] = $rows2['faculty_name'];
		}
	}
}

$smarty->assign('f_id',$f_id);
$smarty->assign('faculties',$faculties);
$smarty->assign('groups',$groups);
$smarty->assign('ids',$ids);

include '../../check.php';
if ($checking == 1)
	$smarty->display('modify_or_delete_group.tpl');
else echo "You are not autorised"; exit;

?>